package me.fanwu.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/*
 * Wupher 编写于 2016/11/2.
 */
@Configuration
public class AlipayConfig {
    private AlipayClient alipayClient;
    public static String Alipay_Service_URL = "https://openapi.alipaydev.com/gateway.do";
    public static String APPID = "2016101400684589";
    public static String APP_Private_Key = "MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMMiMmFDSOq5I2q0\n" +
            "PaK3TENAiZHk4uyr3VKRRhW2YW2ghIoQsfj2g3dMeNFXuVVqzjDBRSGD0iOHpgL5\n" +
            "R/U0N71YVBDlsi0yiZ7He4nwBlzyEZXueibPGNctmGJ8Raq4gcROx47J/MXdZCqL\n" +
            "Bhlp3BH3zgzHifOicJibCZNVfYIhAgMBAAECgYEAhyA8MPxOFzUDoJWWBQLXjc64\n" +
            "NU6CEhBloBK3rLtyNl8syQsMo3HZ0hgjphwQXGUsybhcrfvB3hbGUFLdkKCLY5ym\n" +
            "psMI7T/HtDMJGwednGN2RqtAbWoL9yBx6xZoTe6q67k+pvY4GRGEu0Ku0fiXN9VY\n" +
            "ihIzbB7C1RKt6ccE8AECQQD6XTdDmeaVOBPMnO2NNioXX0b8mF5i3gxWFSHpUeN1\n" +
            "Krk99ews9vymQTVpfpwCaig3YYEQG5nylyUwa4nmKXOhAkEAx4azlOK5shxvI1dW\n" +
            "K37FxUNYjc58wk07PVvHrrnJyOCa6a4reo52fnpWBDDKoBnUEJ+5HaQYRjUSKMEn\n" +
            "hhF+gQJBAKa0pvW2Zlj5rAVUgMDETiad5HCRLFf8ro4rKBdp1WDQ/+OH+qi+FODH\n" +
            "Dr+d9FePRBQMMpn9JvbnOXYSRRIii8ECQDg2myG3PtoPaMBsOrrGXLHW53wMUNnt\n" +
            "KGOBGCEB9vfBT+PGTjmZKYk4rkM/+9ZfcH++gEj5kl01Vohk4t3C0AECQBOWOn18\n" +
            "k4xmcvr7e1nckSKkWafyHf321d+jKu8cIulRYwcUBIW3om6cApZe/3J9eTS5k6nM\n" +
            "1aQ+w3inOxinb7I=";
    @Bean
    public AlipayClient getAlipayClient(){
        if (null == alipayClient){
            this.alipayClient = new DefaultAlipayClient(Alipay_Service_URL, APPID,
                    APP_Private_Key);
        }
        return alipayClient;
    }

}
